﻿<!DCOTYPE  html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>URL查询量</title>
         <link rel="stylesheet" href="/css/theme/font-awesome.min.css" type="text/css" />
        <link rel="stylesheet" href="/css/theme/bootstrap.min.css" type="text/css" />
        <link rel="stylesheet" href="/javascript/theme/libs/jquery-easyui-1.4/themes/default/easyui.css" type="text/css" />
        <link rel="stylesheet" href="/css/theme/App.css" type="text/css" />
        <link rel="stylesheet" href="/css/theme/custom.css" type="text/css" />
        <script src="/javascript/theme/libs/jquery-1.9.1.min.js"></script>
        <script src="/javascript/theme/libs/jquery-easyui-1.4/jquery.easyui.min.js"></script>
        <script src="/javascript/theme/libs/bootstrap.min.js"></script>
        <script src="/javascript/theme/App.js"></script>
        <script type="text/javascript" src="/javascript/My97DatePicker/WdatePicker.js"></script>
        <script type="text/javascript" src="/javascript/report/FusionCharts.js"></script>
        <script type="text/javascript" src="../javascript/report/Date.js"></script>
        <style type="text/css">
            .alink {
            text-decoration:underline;
            color:#0000CC;
            }
            .alinkClicked {
            color:#0000CC;
            }
            #cates,#locals,#cateClean,#localClean{
            display:none;
            }
        </style>
    </head>
    <body>
        <div id="content" style="OVERFLOW-X:yes;OVERFLOW-Y:auto;">
            <div id="content-container">
                <form action="/Statistics/TrackURLtoPVUV" class="form-horizontal" name="searchform" role="form" method="post"  onsubmit="return check();">
                    <div class="portlet">
                        <div class="portlet-header">
                            <h3>
                                <i class="fa fa-tasks"></i>
                                 pagetype查流量
                            </h3>
                        </div>
                        <!-- /.portlet-header -->
<div class="portlet-content">
  </br>
   <div class="form-group">
    <label class="col-md-2">&nbsp;&nbsp;日 期 :</label>
    <div class="col-md-2">
        <input  type="text" id="startDate" name="startDate" style="width:150px" class="Wdate form-control" value="$!{startDate}" onclick="WdatePicker({skin:'ext',dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-#{%d}'})"/>
    </div>
    <label class="col-md-2">---</label>
    <div class="col-md-2">
        <input  type="text" id="endDate" name="endDate" style="width:150px" class="Wdate form-control" value="$!{endDate}" onclick="WdatePicker({skin:'ext',dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-#{%d}'})"/>
    </div>
    <div class="col-md-2">
        <input type="radio" name="selectdate" onclick="selectDate('-7')"/>
        近7天
        <input type="radio" name="selectdate" onclick="selectDate('-1m')"/>
        近1月
    </div>
</div>
<div class="form-group">
<label class="col-md-2">&nbsp;&nbsp;平  台 : </label>
<div class="col-md-2">
        <input type="radio" name="platform" value="PC" #if($!{platform}=='PC') checked #end  />PC&nbsp;&nbsp;&nbsp;
        <input type="radio" name="platform" value="M" #if($!{platform}=='M') checked #end /> M &nbsp;&nbsp;&nbsp;
        <input type="radio" name="platform" value="ganjiPC" #if($!{platform}=='ganjiPC') checked #end  />赶集PC&nbsp;&nbsp;&nbsp;
        <input type="radio" name="platform" value="ganjiM" #if($!{platform}=='ganjiM') checked #end /> 赶集M &nbsp;&nbsp;&nbsp;
        <input type="radio" name="platform" value="chinahrPC" #if($!{platform}=='chinahrPC') checked #end  />中华英才网PC&nbsp;&nbsp;&nbsp;
        <input type="radio" name="platform" value="chinahrM" #if($!{platform}=='chinahrM') checked #end /> 中华英才网M &nbsp;&nbsp;&nbsp;
</div>
</div>
<div class="form-group">
    <label class="col-md-2">&nbsp;&nbsp;维度选择: </label>
    <div class="col-md-2">
       <input type="checkbox" name="statCombine" id="statCombine" value="statdate" #if($!{statCombine}=='statdate') checked #end  />
           日期&nbsp;&nbsp;&nbsp;
    </div>
</div>
<div class="form-group">
    <label class="col-md-2">&nbsp;&nbsp;查询条件: 
    </label>
    <label class="col-md-2">&nbsp;&nbsp;pagetype: </label>
    <div class="col-md-2">
    <input type="text" class="form-control" style="width:50px" name="pagetype" id="pagetype" value="$!{pagetype}" />
    </div>&nbsp;
    <label class="col-md-2">&nbsp;&nbsp;page: </label>
    <div class="col-md-2">
    <input type="text" class="form-control" style="width:50px" name="page" id="page" value="$!{page}" />
    </div>&nbsp;
    <label class="col-md-2">&nbsp;&nbsp;area: </label>
    <div class="col-md-2">
    <input type="text" class="form-control" style="width:50px" name="area" id="area" value="$!{area}" />
    </div>&nbsp;
    <label class="col-md-2">&nbsp;&nbsp;cate1: </label>
    <div class="col-md-2">
    <input type="text" class="form-control" style="width:50px" name="cate1" id="cate1" value="$!{cate1}" />
    </div>&nbsp;
    <label class="col-md-2">&nbsp;&nbsp;cate2: </label>
    <div class="col-md-2">
    <input type="text" class="form-control" style="width:50px" name="cate2" id="cate2" value="$!{cate2}" />
    </div>&nbsp;
    <textarea style="width:100px;height:20px"  hidden="hidden"  name="typename" id="typename" value="$!{typename}" >$!{selecttype}</textarea>
    <input type="submit" class="btn btn-primary btn-xs" value="查询"  />&nbsp;&nbsp;&nbsp;
    <button type="button" id="download" name="download" onclick="downword()" class="btn btn-primary btn-xs">
                            导出EXCEL
    </button>
</div>
</div>
</div><!--portlet-content-->
</div><!--portlet-->
</form>
 #if($rsList)
<div class="portlet">
    <div class="portlet-header">
        <h3>
            <i class="fa fa-hand-o-up"></i>
            查询结果
        </h3>
    </div>
        <div class="portlet-content">
            <div class="table-responsive">
                <table class="table table-striped table-bordered table-hover" id="wordtable" data-provide="datatable" data-display-rows="20" >
                    <thead>
                        <tr>
                                #if($!{statCombine}=='statdate')
                                   <th  style="text-align:center;">日期</th>
                                #end
                                <th  style="text-align:center;">pagetype</th>
                                <th  style="text-align:center;">page</th>
                                <th  style="text-align:center;">area</th>
                                <th  style="text-align:center;">cate1</th>
                                <th  style="text-align:center;">cate2</th>
                                <th  style="text-align:center;">PV量</th>
                                <th  style="text-align:center;">UV量</th>
                                <th  style="text-align:center;">新访客量</th>
                        </tr>
                    </thead>
                    <tbody>
                        #foreach($rs in $rsList)
                            <tr  align="center" >
                                    #if($!{statCombine}=='statdate')
                                      <td>$!rs.statdate</td> 
                                    #end 
                                    <td>$!rs.pagetype</td>  
                                    <td>$!rs.page</td>
                                    <td>$!rs.area</td>
                                    <td>$!rs.cate1</td>
                                    <td>$!rs.cate2</td>
                                    <td>$!rs.url_pv</td>
                                    <td>$!rs.url_uv</td>
                                    <td>$!rs.Newuv</td>
                            </tr>
                        #end												
                    </tbody>
                </table>
                 <div class="row dt-rb">
                            #parse("/views/default/newpage.vm")
                            #pagenew($pList "/Statistics/TrackURLtoPVUV?#page#&$paramurl")
                </div>
            </div>
        </div>
</div>
 #end
</div>
</div>
<script >
    function downword(){
        check();
        document.getElementById('typename').value="excel";
        searchform.submit();
        document.getElementById('typename').value="";
    }
    function textclear(){
        document.getElementById('URLname').value="";
    }
    function formatDate(oldDate) { 
        var dates = oldDate.split("-");
        var newDate = dates[0];
        
        for(var i = 1;i < dates.length; i++){
            var temp = dates[i];
            if(temp < 10){  
                newDate = newDate+"-0"+temp
            }else{
                newDate = newDate+"-"+temp
            }
        }
    
        return newDate;
    }  
    function selectDate(dayNum){
        var endDate = new Date();
        var startDate = "";
        if(dayNum == "-7"){
        var uom = new Date(new Date()-0+(-7)*86400000);
        startDate = uom.getFullYear() + "-" +  (uom.getMonth()+1) + "-" + uom.getDate();
        }else if(dayNum == "-1m"){
        if(endDate.getMonth() == 0){
        startDate = endDate.getFullYear()-1 + "-12-" + endDate.getDate();
        }else{
        startDate = endDate.getFullYear() + "-" + endDate.getMonth() + "-" + endDate.getDate();
        }
        }
        endDate = endDate.getFullYear() + "-" +  (endDate.getMonth()+1) + "-" + endDate.getDate();
        startDate = formatDate (startDate);
        endDate = formatDate (endDate);
        $("#endDate").val(endDate);
        $("#startDate").val(startDate);
    }
    function check(){
        var startDate = $("#startDate").val();
        if(startDate == ""){
        alert("请选择起始时间!");
        return false;
        }
        var endDate = $("#endDate").val();
        if(endDate == ""){
        alert("请选择截止时间!");
        return false;
        }
        if(startDate>endDate){
        alert("截止时间不能大于起始时间!");
        return false;
        }
    }
</script>
</body>
</html>
